package xpn.platform.modules.template.excel;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import xpn.platform.common.persistence.AbstractBaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;

/**
 * Excel模板
 *
 * @author bobatkm Nov 10, 2017
 */
@Entity
@Getter
@Setter
@Table(name = "template_excel")
public class Excel extends AbstractBaseEntity {

    private static final long serialVersionUID = -7324682276093151275L;

    /**
     * 名称
     */
    @Column(length = 60)
    @Length(min = 2, max = 60)
    @NotEmpty
    private String name;

    /**
     * 排序号
     */
    private Float sortNo;

    /**
     * 编号
     */
    @Column(unique = true, length = 60)
    @Length(min = 2, max = 60)
    @NotEmpty
    private String no;

    /**
     * 规则
     */
    @Lob
    private String rules;

    /**
     * 描述
     */
    @Column(length = 100)
    @Length(min = 0, max = 100)
    private String description;
}